<?php include 'header.php'; ?>

	  <div id="teaser">
	  </div>


	  <div id="main">


			<div id="gauche">
				<div class="nothing">
					<?php include 'sidebar.php'; ?>
				</div>
			</div>

			<div id="droite">
			<div class="nothing">
				<div class="subcolumns">
					<div class="c25l">
						<div class="subcl">
							<div class="ylert">
								<strong>Notes:</strong>
								<p>Voici le formulaire de contact. Que ce soit pour:
								<ul class="list-circle">
									<li>Nous faire pleins de compliments,</li>
									<li>Nous dire que vous adorez ce que l'on fait,</li>
									<li>Ou &eacute;ventuellement nous faire une petite remarque sur l'utilisation du site ;) ,</li>
									
								</ul>
								n'h&eacute;sitez surtout pas &agrave; nous contacter! 
								</p>
							</div>

						</div>
					</div>

					<div id="contactform" class="c75r">
					<?php
									if(isset($_POST['send'])){
										$emailFrom = "contact@kune.fr";
										$emailTo = "contact@kune.fr";
										$subject = "Contact Form Submission";

										$name = strip_tags($_POST['name']); 
										$city = strip_tags($_POST['city']); 
										$email = strip_tags($_POST['email']); 
										$message = strip_tags(stripslashes($_POST['message'])); 

										$body = "Name: ".$name."\n";
										$body .= "City: ".$city."\n";
										$body .= "Email: ".$email."\n";
										$body .= "Message: ".$message."\n";

										$headers = "From: ".$emailFrom."\n";
										$headers .= "Reply-To:".$email."\n";	

										if($_SESSION['security_code'] == $_POST['security_code']){
											$success = mail($emailTo, $subject, $body, $headers);
											if ($success){
											echo '<p class="yay">All is well, your e&ndash;mail has been sent.</p>';
											} 
										} 
										else 
										{
											echo '<p class="oops">Something went wrong; maybe you clicked it too hard... you did, didn&rsquo;t you?</p>';
										}
										} else {
									?>
									<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="contact" name="contact">
										<fieldset>
											<legend>Contact form</legend>
											<label for="name">Name</label>
											<input type="text" id="name" name="name" class="required" minlength="2"/>

											<label for="city">City</label>
											<input type="text" id="city" name="city" class="required" minlength="2"/>

											<label for="email">E&ndash;mail</label>
											<input type="text" id="email" name="email" class="required email"/>

											<label for="message">Message</label>
											<textarea id="message" name="message" cols="50" rows="10" class="required"></textarea>

											<h3>Are you human?</h3>
											<img src="captcha.php" id="captcha" alt="captcha"/>
											<label for="security_code">Enter captcha</label>
											<input type="text" id="security_code" name="security_code" autocomplete="off" class="required"/>

											<button type="submit" id="send" name="send">Send!</button>
										</fieldset>
									</form>
									<?php } ?>
						
					</div>
				</div>
			</div>


<?php include 'footer.php'; ?>